package net.hn.hnms.biz.material.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.hn.hnms.biz.material.service.IStatisticService;
import net.hn.hnms.biz.material.vo.MaterialCostVO;
import net.hn.hnms.biz.material.vo.StatisticVO;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "统计相关", tags = {"统计相关"})
@RestController
@RequestMapping("/statistic")
public class StatisticController {


    @Autowired
    private IStatisticService statisticService;

    @ApiOperation("经营概览-物资统计")
    @RequestMapping("/total")
    @AutoSetMineCode
    public R<StatisticVO> total(@ApiParam(value = "煤矿编码") String mineCode, Integer limit){
        return R.ok(statisticService.total(mineCode,limit));
    }



    @ApiOperation("生产成本-物资成本")
    @RequestMapping("/material/cost")
    @AutoSetMineCode
    public R<List<MaterialCostVO>> materialCost(@ApiParam(value = "煤矿编码") String mineCode, Integer year){
        return R.ok(statisticService.materialCost(mineCode,year));
    }

}
